//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#if !defined(_ROT_H_)
#define _ROT_H_

#include <assert.h>
#include <linknode.h>

typedef struct ExportObject: SLinkNode {
    oid_t             m_oid;
    IInterface        *m_pObject;
    IStub           *m_pIStub;
} ExportObject;

typedef struct ImportObject: SLinkNode {
    oid_t             m_oid;
    IProxy          *m_pIProxy;
} ImportObject;

extern ECode InitializeROT();

extern ECode RegisterExportObject(
        /* [in] */ oid_t oid,
        /* [in] */ IInterface *pObject,
        /* [in] */ IStub *pIStub);

extern ECode UnregisterExportObject(
        /* [in] */ oid_t oid);

extern ECode FindExportObject(
        /* [in] */ IInterface *pObject,
        /* [out] */ ExportObject *pExport);

extern ECode FindExportObject(
        /* [in] */ oid_t oid,
        /* [out] */ ExportObject *pExport);

extern ECode RegisterImportObject(
        /* [in] */ oid_t oid,
        /* [in] */ IProxy *pIProxy);

extern ECode UnregisterImportObject(
        /* [in] */ oid_t oid);

extern ECode FindImportObject(
        /* [in] */ oid_t oid,
        /* [out] */ ImportObject *pImport);

#endif // _ROT_H_
